package cn.itcast.dao;

import cn.itcast.domain.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface StudentDao {
    @Select("select * from student")
    List<Student> findAll();
    @Insert(" INSERT INTO student(id,name,age) VALUES(#{id},#{name},#{age})")
    int save(Student account);
    @Delete(" delete from student where id=#{id}")
    int delete(Integer id);
    @Update("update student set name=#{name},age=#{age} where id=#{id}")
    int update(Student student);
    @Select("select * from student where id=#{id}")
    List<Student> findBy(Integer id);
}
